#!/bin/bash

# Java 应用状态检查脚本
APP_NAME="wechat-login"
PID_FILE="/var/run/$APP_NAME.pid"

if [ ! -f "$PID_FILE" ]; then
    echo "$APP_NAME is not running"
    exit 1
fi

PID=$(cat $PID_FILE)

if ps -p $PID > /dev/null; then
    echo "$APP_NAME is running (PID: $PID)"
else
    echo "$APP_NAME is not running but PID file exists"
fi
